package com.doyens.gmall.list.client;

import com.doyens.gmall.common.result.Result;
import com.doyens.gmall.list.client.impl.ListFeignClientImpl;
import com.doyens.gmall.model.list.SearchParam;
import com.doyens.gmall.model.list.SearchResponseVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.io.IOException;

@FeignClient(value = "service-list",fallback = ListFeignClientImpl.class)
public interface ListFeignClient {
    //商品详情的service中远程调用更新热度
    @GetMapping("api/list/inner/incrHotScore/{skuId}")
    public Result incrHotScore(@PathVariable("skuId") Long skuId);

    /**
     * 搜索商品
     *
     * @param searchParam 页面的搜索条件
     * @return 搜索结果，包含商品、品牌、平台属性等
     * @throws IOException
     **/
    @PostMapping("api/list")
     Result list(@RequestBody SearchParam searchParam);
}
